<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>天院美食网</title>
<link rel="stylesheet" href="${basePath}/css/main.css" type="text/css" />
	<script type="text/javascript">
		<!--将结账的图片设置成提交按钮 -->
		function h() {
		    document.getElementById();
        }
	</script>
</head>

<body class="main">
	<jsp:include page="${basePath}/head.jsp" />
	<jsp:include page="${basePath}/menu_search.jsp" />
	<div id="divpagecontent">
		<table width="100%" border="0" cellspacing="0">
			<tr>
				<td><div style="text-align:right; margin:5px 10px 5px 0px">
						<a href="${basePath}/html.jsp">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;购物车
					</div>
					<table cellspacing="0" class="infocontent">
						<tr>
							<td><img src="${basePath}/images/carhead.jpg" width="666" height="89" />
								<table width="100%" border="0" cellspacing="0">
									<tr>
										<td><img src="${basePath}/images/buy1.jpg" width="635" height="38" />
										</td>
									</tr>
									<tr>
										<td>
											<table cellspacing="1" class="carttable">
												<tr>
													<td width="10%">序号</td>
													<td width="30%">商品名称</td>
													<td width="10%">价格</td>
													<td width="20%">数量</td>
													<td width="10%">库存</td>
													<td width="10%">小计</td>
													<td width="10%">删除</td>
												</tr>
											</table>
											<c:set var="sum" value="0"></c:set>
											<c:forEach items="${car}" var="cars" varStatus="qhycar">
												<table width="100%" border="0" cellspacing="0">
													<tr>

														<td width="10%">${qhycar.count}</td>
														<td width="30%">${cars.value.product.name}</td>
														<td width="10%">${cars.value.product.price}</td>
														<td width="20%" align="right">${cars.value.count}</td>
														<td width="10%">${cars.value.product.pnum}</td>
														<td width="10%">${cars.value.total}</td>
														<td width="10%"><a onclick="return hy()" href="${pageContext.request.contextPath}/product/deleteCar.action?id=${cars.value.product.id}"
															style="color:#FF0000; font-weight:bold">X</a></td>
													</tr>
												</table>
												<c:set var="sum" value="${sum+cars.value.total}"></c:set>
											</c:forEach>
											<table cellspacing="1" class="carttable">
												<tr>
													<td style="text-align:right; padding-right:40px;"><font
														style="color:#FF6600; font-weight:bold">合计:${sum}元</font>
													</td>
												</tr>
											</table>
											<div style="text-align:right; margin-top:10px">
												<a
													href="${pageContext.request.contextPath}/product/pageListProduct.action"><img
													src="${basePath}/images/gwc_jx.gif" border="0" /> </a>
												&nbsp;&nbsp;&nbsp;&nbsp;<a
													href="${pageContext.request.contextPath}/order.jsp"><img
													src="${basePath}/images/gwc_buy.gif" border="0" onclick="h" /> </a>
											</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table></td>
			</tr>
		</table>
	</div>
	<jsp:include page="${basePath}/foot.jsp" />
</body>

<script type="text/javascript">
   function hy() {
       if (window.confirm("确定要删除该商品吗？")){
           return true;
	   }else {
           return false;
	   }
   }

</script>
</html>
